package com.atlin.project.model.vo;

import cn.hutool.json.JSONUtil;
import com.atlin.project.model.domain.className_C;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 示例表
 *
 * @TableName className_L
 */
@Data
public class className_CVO implements Serializable {

    request_content

    /**
     * 包装类转对象
     *
     * @param className_LVO
     * @return
     */
    public static className_C voToObj(className_CVO className_LVO) {
        if (className_LVO == null) {
            return null;
        }
        className_C className_L = new className_C();
        BeanUtils.copyProperties(className_LVO, className_L);
        List<String> tagList = className_LVO.getTags();
        if (tagList != null) {
            className_L.setTags(JSONUtil.toJsonStr(tagList));
        }
        // todo other operation

        return className_L;
    }


    /**
     * 对象转包装类
     *
     * @param className_L
     * @return
     */
    public static className_CVO objToVo(className_C className_L) {
        if (className_L == null) {
            return null;
        }
        className_CVO className_LVO = new className_CVO();
        BeanUtils.copyProperties(className_L, className_LVO);
        List<String> tagList = JSONUtil.toList(className_L.getTags(), String.class);
        className_LVO.setTags(tagList);
        // todo other operation

        return className_LVO;
    }

    private static final long serialVersionUID = 1L;
}